import request from '@/utils/request'

// 分页查询考勤规则
export function pageRules(params) {
  return request({
    url: '/att-rule/page',
    method: 'get',
    params
  })
}

// 获取规则详情
export function getRule(id) {
  return request({
    url: `/att-rule/${id}`,
    method: 'get'
  })
}

// 创建考勤规则
export function createRule(data) {
  return request({
    url: '/att-rule',
    method: 'post',
    data
  })
}

// 更新考勤规则
export function updateRule(data) {
  return request({
    url: '/att-rule',
    method: 'put',
    data
  })
}

// 删除考勤规则
export function deleteRule(id) {
  return request({
    url: `/att-rule/${id}`,
    method: 'delete'
  })
}

// 更新规则状态
export function updateRuleStatus(id, status) {
  return request({
    url: `/att-rule/${id}/status`,
    method: 'put',
    params: { status }
  })
} 